package com.sangmo.fts.process.inventory.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.inventory.interfaces.IfWaybillItemCreation;
import com.sangmo.fts.process.inventory.model.IfLadingBillItem;
import com.sangmo.fts.process.inventory.model.IfStockItem;
import com.sangmo.fts.process.inventory.model.IfWaybill;
import com.sangmo.fts.process.inventory.model.IfWaybillItem;
import com.sangmo.fts.process.inventory.repo.IfWaybillItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;


@Service
@Transactional
public class IfWaybillItemEntityService extends BaseViewService<IfWaybillItem> {

    @Autowired
    private IfWaybillItemRepo ifWaybillItemRepo;

    @Override
    protected IDataViewRepo<IfWaybillItem> getRepo() {
        return ifWaybillItemRepo;
    }

    protected List<IfWaybillItem> listByWaybillId(Long waybillId) {
        return ifWaybillItemRepo.findByWaybillId(waybillId);
    }

    protected List<IfWaybillItem> saveAll(List<IfWaybillItem> waybillItems) {
        return ifWaybillItemRepo.saveAll(waybillItems);
    }



}
